package init;

import model.User;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class UserInit {
    public static ArrayList<User> users = new ArrayList<>();
    public UserInit() throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader("user.txt"));
        String data = null;
        while((data = bufferedReader.readLine()) != null){
                String[] split = data.split(",");
                String s0 = split[0];
                String s1 = split[1];
                String s2 = split[2];
                String s3 = split[3];
                String s4 = split[4];
                String s5 = split[5];
                User user = new User(Integer.valueOf(s0),s1,s2,Integer.valueOf(s3),s4,Double.valueOf(s5));
                users.add(user);
                //System.out.println(s1);
        }
    }
}
